//
//  MainCollectionViewCell.m
//  WZYInteriorDesign
//
//  Created by lanou on 15/12/17.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "MainCollectionViewCell.h"
#import "UIImageView+AFNetworking.h"
#import "MainDetailModel.h"
@implementation MainCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        CGFloat totalWidth = self.frame.size.width;
        CGFloat totalHeight = self.frame.size.height;
        
        _pictureView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, totalWidth, totalHeight)];
        _pictureView.backgroundColor = [UIColor redColor];
        [self addSubview:_pictureView];
       
        _numLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, totalHeight - 30, totalWidth, 30)];
        [self addSubview:_numLabel];
    }
    return self;
}


- (void)setMainDetail:(MainDetailModel *)mainDetail{
    if (_mainDetail != mainDetail) {
        _mainDetail = mainDetail;
        [_pictureView setImageWithURL:[NSURL URLWithString:mainDetail.pic]];
        _numLabel.text = mainDetail.author_type;
    }
}









@end
